﻿Imports DB
Imports System.Data.SqlClient

Public Class Registration
    Inherits System.Web.UI.Page

    Dim ws As ClientWebService.GetDataSoapClient


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        lblTravNameExists.Visible = False
        lblTravNameNotFound.Visible = False

    End Sub

    Protected Sub btnRegistreer_Click(sender As Object, e As EventArgs) Handles btnRegistreer.Click
        Dim msg As String
        Dim member As New ClientWebService.Users

        ws = New ClientWebService.GetDataSoapClient
        If (ws.Web_CheckIfUserExists(TxtUserNaam.Text)) Then
            lblTravNameExists.Visible = True
        Else
            Dim PID As Integer = ws.CheckIfMemberExists(txtTravNaam.Text)
            If (PID <> 9999) Then
                msg = ws.Web_RegisterUser(TxtUserNaam.Text, txtPaswoord.Text, txtEmail.Text, txtVolNaam.Text, DropListLanden.SelectedItem.ToString, PID)
                Response.Write(msg)
                Response.Redirect("Login.aspx")
            Else
                lblTravNameNotFound.Visible = True
            End If
        End If
    End Sub
End Class